﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace TinyEngine.Core
{
    public static class Extensions
    {
        public static Vector3 ToVector3(this Vector2 vec)
        {
            return new Vector3(vec, 0);
        }

        public static Vector2 ToVector2(this Vector3 vec)
        {
            return new Vector2(vec.X, vec.Y);
        }

        public static Point ToPoint(this Vector2 vec)
        {
            return new Point((int)vec.X, (int)vec.Y);
        }

        public static Point ToPoint(this Vector3 vec)
        {
            return new Point((int)vec.X, (int)vec.Y);
        }

        public static float ToRadians(this Vector2 direction)
        {
            return (float)Math.Atan2(-direction.Y, direction.X);
        }

        public static float ToRadians(this Vector3 direction)
        {
            return (float)Math.Atan2(-direction.Y, direction.X);
        }
    }
}
